#ifndef ADDFRIENDDIALOG_H
#define ADDFRIENDDIALOG_H

#include <QWidget>
#include <QDialog>
#include <QLineEdit>
#include <QPushButton>
#include <QScrollArea>
#include <QScrollBar>
#include <QGridLayout>
#include "model/data.h"
#include <QLabel>
#include "debug.h"
#include "model/datacenter.h"

using namespace model;

class AddFriendDialog : public QDialog
{
    Q_OBJECT
public:
    AddFriendDialog(QWidget *parent = nullptr);
    // 添加⼀个结果
    void addResult(const UserInfo& userInfo);
    // 清空结果
    void clear();
    // 设置输⼊框显⽰内容
    void setSearchKey(const QString& searchKey);
    void clickSearchBtn();
    void clickSearchBtnDone();

private:
    QLineEdit* searchEdit;
    QPushButton* searchBtn;

    QWidget* resultContainer;
    void initResultArea(QGridLayout* layout);

signals:
};

class FriendResultItem : public QWidget
{
    Q_OBJECT
public:
    FriendResultItem(const UserInfo& userInfo);

    void clickAddBtn();
private:
    //存储信息
    const UserInfo& userInfo;
    // 添加好友按钮
    QPushButton* addBtn;

signals:
};






#endif // ADDFRIENDDIALOG_H
